// 引入基础配置
import config from './config';

export default (url,data={},method='get')=>{
    return new Promise((resolve,reject)=>{
        wx.request({
            url: config.host + url,
            method,
            data,
            success:(res)=>{
                resolve(res.data)
            },
            fail:(error)=>{
                reject(error)
            }
        })
    })
}